#ifndef WORLD_H
#define WORLD_H


#include "Board.h"
#include "GameObject.h"

#include <string>
#include "Wall.h"
#include "Robot.h"
#include "Pusher.h"
#include "Laser.h"
#include "Spinner.h"

class World
{
public:
	World();
	virtual ~World();

	void Resize(unsigned int width, unsigned int height);

	virtual Wall* CreateWall(const Direction& direction, unsigned int cellX, unsigned int cellY) = 0;
	virtual Pusher* CreatePusher(const Direction& direction, unsigned int cellX, unsigned int cellY) = 0;
	virtual Laser* CreateLaser(const Direction& direction, unsigned int cellX, unsigned int cellY) = 0;
	virtual Robot* CreateRobot(const std::string& type, unsigned int cellX, unsigned int cellY) = 0;
	virtual Spinner* CreateSpinner(const Direction& direction, unsigned int cellX, unsigned int cellY) = 0;


	void Clear();
	virtual void Simulate();
	virtual void BeginBehaviorSimulation();
	virtual void EndBehaviorSimulation();

	void AddObject(GameObject* object);

protected:
	virtual Board* CreateBoard();
private:

	Board* board;
	std::list<GameObject*> objects;
};

#endif //WORLD_H
